package com.online.olsrootserver.slave1;

import com.online.olsrootserver.entity.Message;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * Created by littleheng on 2018/4/27
 */
@Mapper
public interface Message1Mapper {

    @Select("select uuid, direction, type, content, create_time, read_status, company_id, session_id from ols_message where session_id = #{sessionId}")
    List<Message> getMessageList(@Param("sessionId")String sessionId);

    @Insert("insert into ols_message(uuid, direction, type, content, create_time, read_status, company_id, session_id) values(#{uuid}, #{direction}, #{type}, #{content}, #{createTime}, #{readStatus}, #{companyId}, #{sessionId})")
    int insertMessage(Message message);
}
